const path = require('path');

module.exports = {
  // entry: path.resolve(__dirname, '../src/index.js'),
  entry: {
    main: path.resolve(__dirname, '../src/index.js'),
    test: path.resolve(__dirname, '../src/assets/js/test.js')
  },
  output: {
    path: path.resolve(__dirname, '../dist'),
    filename: 'js/[name].[contenthash:8].js'
  },
  module: {
    rules: [
      {
        oneOf: [
          {
            test: /\.js$/,
            loader: 'babel-loader',
            options: {
              presets: [
                '@babel/preset-env'
              ],
              cacheDirectory: true
            }
          }
        ]
      }
    ]
  },
  plugins: [],
  optimization: {
    splitChunks: {
      chunks: 'all'
    }
  },
  mode: 'development'
}
